package com.lmk.exception;


import com.lmk.enums.GlobalErrorCode;
import lombok.Data;

@Data
public class MyGlobalCustomException extends RuntimeException{
    // 异常消息
    private String errorMessage;
    // 异常码
    private String errorCode;
    public MyGlobalCustomException() {

    }

    public MyGlobalCustomException(String message) {
        super(message);
    }

    public MyGlobalCustomException(String errorMessage,String errorCode) {
        super(errorMessage);
        this.errorMessage=errorMessage;
        this.errorCode=errorCode;
    }

    public MyGlobalCustomException(GlobalErrorCode globalErrorCode) {
        super(globalErrorCode.getMessage());
        this.errorMessage=globalErrorCode.getMessage();
        this.errorCode=globalErrorCode.getCode();
    }
}
